//
//  IMKeyWordCheckHelper.m
//  BaseProject
//
//  Created by 王洋 on 2021/4/14.
//  Copyright © 2021 王洋. All rights reserved.
//

#import "IMKeyWordCheckHelper.h"

@implementation IMKeyWordCheckHelper

+ (void)checkUserMsg:(NSString *)msg comption:(void (^)(BOOL success, IMAlertActionType type, NSString *message))comption {
    
    //从已经下载的地方去获取
    NSArray *array = [TTUserModel sharedObject].imKeyWordArray.mutableCopy;
    
    int count = 0;    
    for (NSString *str in array) {
        if ([msg containsString:str]) {
            count++;
        }
    }
    
    if (count > 0) {
        comption(YES, IMAlertActionType_sendUserInfo, @"");
    } else {
        comption(NO, IMAlertActionType_none, @"未查询到相关关键词");
    }
}
@end
